package com.whfc.emp.dao;

import com.whfc.emp.dto.AppTrainingDTO;
import com.whfc.emp.dto.AppTrainingQuestionsDTO;
import com.whfc.emp.dto.AppTrainingQuestionsOptionsDTO;
import com.whfc.emp.entity.AppTraining;
import com.whfc.emp.entity.AppTrainingQuestion;
import com.whfc.emp.param.AppTrainingListParam;
import com.whfc.emp.param.AppTrainingQuestionListParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: realm
 * @date: 2025-10-22 15:24
 * @description: //todo
 */
public interface AppTrainingQuestionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppTraining record);

    int insertSelective(AppTraining record);

    AppTrainingQuestionsDTO selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppTraining record);

    int updateByPrimaryKey(AppTraining record);

    /**
     * 获取
     *
     * @param request
     * @return
     */
    List<AppTrainingQuestionsDTO> selectByParam(AppTrainingQuestionListParam request);

    /**
     * 删除
     *
     * @param id
     */
    void deleteLogicById(@Param("id") Integer id);


    /**
     * 获取选项
     *
     * @param id
     * @return
     */
    List<AppTrainingQuestionsOptionsDTO> selectOptionsByQuestionId(@Param("id") Integer id);

    /**
     * 批量获取
     *
     * @param questionIds
     * @return
     */
    List<AppTrainingQuestionsDTO> selectByIds(@Param("questionIds") List<Integer> questionIds);

    /**
     * 批量插入
     *
     */
    void insertBatchByTrainingId(@Param("questions") List<AppTrainingQuestion> questions);

    Integer countByTrainingId(@Param("id") Integer id);
}